package com.tsd.system.dao;

import com.tsd.core.vo.PageBean;
import com.tsd.system.entity.SysGroupPerson;
import com.tsd.system.entity.SysGroupPersonExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 描述：SysGroupPersonMapper
 *
 * @author zsy
 * @date 2020/12/29 15:52:20
 */
public interface SysGroupPersonMapper {

    SysGroupPerson selectByPrimaryKey(Long id);

    SysGroupPersonExt selectBySid(String sid);

    int deleteByPrimaryKey(Long id);

    int insert(SysGroupPerson record);

    int insertSelective(SysGroupPerson record);

    int updateByPrimaryKey(SysGroupPerson record);

    int updateByPrimaryKeySelective(SysGroupPerson record);

    List<SysGroupPersonExt> selectByEntity(SysGroupPerson record);

    List<SysGroupPersonExt> selectByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<SysGroupPersonExt> selectCount1Page(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<SysGroupPersonExt> selectByParams(@Param("params") Map<String, Object> params);

    /**
     * 统计部门下编号同名数量
     *
     * @param group_sid
     * @param code
     * @return
     */
    int countByGroupSidAndCode(@Param("group_sid") String group_sid, @Param("code") String code);

    /**
     * 统计账号绑定人数
     *
     * @param user_sid
     * @return
     */
    int countByUserSid(@Param("user_sid") String user_sid);

    /**
     * 删除部门下的客户
     *
     * @param group_sid
     * @return
     */
    int deleteByGroupSid(@Param("group_sid") String group_sid);

    int batchUpdateUserBySid(@Param("sid_list") List<String> sid_list, @Param("user_sid") String user_sid);

    int countValid();

    void removeBindByUserSid(@Param("user_sid") String user_sid);
}
